/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scittbfadece")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scittbfadece.findAll", query = "SELECT s FROM Scittbfadece s"),
    @NamedQuery(name = "Scittbfadece.findByScittbfadeceid", query = "SELECT s FROM Scittbfadece s WHERE s.scittbfadeceid = :scittbfadeceid"),
    @NamedQuery(name = "Scittbfadece.findByNombre", query = "SELECT s FROM Scittbfadece s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Scittbfadece.findByFacultad", query = "SELECT s FROM Scittbfadece s WHERE s.facultad = :facultad"),
    @NamedQuery(name = "Scittbfadece.findBySiglas", query = "SELECT s FROM Scittbfadece s WHERE s.siglas = :siglas"),
    @NamedQuery(name = "Scittbfadece.findByDireccion", query = "SELECT s FROM Scittbfadece s WHERE s.direccion = :direccion"),
    @NamedQuery(name = "Scittbfadece.findByObservaciones", query = "SELECT s FROM Scittbfadece s WHERE s.observaciones = :observaciones")})
public class Scittbfadece implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scittbfadeceid")
    private Integer scittbfadeceid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Column(name = "facultad")
    private boolean facultad;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 7)
    @Column(name = "siglas")
    private String siglas;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 250)
    @Column(name = "direccion")
    private String direccion;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(mappedBy = "scittbfadeceid")
    private Collection<Scsgtbusurol> scsgtbusurolCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scittbfadeceid")
    private Collection<Scittbescun> scittbescunCollection;
    @JoinColumn(name = "scthtbdatosgenid", referencedColumnName = "scthtbdatosgenid")
    @ManyToOne(optional = false)
    private Scthtbdatosgen scthtbdatosgenid;
    @JoinColumn(name = "scintborganismid", referencedColumnName = "scintborganismid")
    @ManyToOne(optional = false)
    private Scintborganism scintborganismid;
    @OneToMany(mappedBy = "scittbfadeceid")
    private Collection<Pyfntbpedestad> pyfntbpedestadCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scittbfadeceid")
    private Collection<Pyfntbpedvicom> pyfntbpedvicomCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scittbfadeceid")
    private Collection<Pyfntbpersvico> pyfntbpersvicoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scittbfadeceid")
    private Collection<Pydgtbproyec> pydgtbproyecCollection;

    public Scittbfadece() {
    }

    public Scittbfadece(Integer scittbfadeceid) {
        this.scittbfadeceid = scittbfadeceid;
    }

    public Scittbfadece(Integer scittbfadeceid, String nombre, boolean facultad, String siglas, String direccion) {
        this.scittbfadeceid = scittbfadeceid;
        this.nombre = nombre;
        this.facultad = facultad;
        this.siglas = siglas;
        this.direccion = direccion;
    }

    public Integer getScittbfadeceid() {
        return scittbfadeceid;
    }

    public void setScittbfadeceid(Integer scittbfadeceid) {
        this.scittbfadeceid = scittbfadeceid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public boolean getFacultad() {
        return facultad;
    }

    public void setFacultad(boolean facultad) {
        this.facultad = facultad;
    }

    public String getSiglas() {
        return siglas;
    }

       public String getFacultadFilter() {
           String FacultadFilter="NO";
           if (facultad==true)
               FacultadFilter="SI";
        return FacultadFilter;
    }
    
    public void setSiglas(String siglas) {
        this.siglas = siglas;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Scsgtbusurol> getScsgtbusurolCollection() {
        return scsgtbusurolCollection;
    }

    public void setScsgtbusurolCollection(Collection<Scsgtbusurol> scsgtbusurolCollection) {
        this.scsgtbusurolCollection = scsgtbusurolCollection;
    }

    @XmlTransient
    public Collection<Scittbescun> getScittbescunCollection() {
        return scittbescunCollection;
    }

    public void setScittbescunCollection(Collection<Scittbescun> scittbescunCollection) {
        this.scittbescunCollection = scittbescunCollection;
    }

    public Scthtbdatosgen getScthtbdatosgenid() {
        return scthtbdatosgenid;
    }

    public void setScthtbdatosgenid(Scthtbdatosgen scthtbdatosgenid) {
        this.scthtbdatosgenid = scthtbdatosgenid;
    }

    public Scintborganism getScintborganismid() {
        return scintborganismid;
    }

    public void setScintborganismid(Scintborganism scintborganismid) {
        this.scintborganismid = scintborganismid;
    }

    @XmlTransient
    public Collection<Pyfntbpedestad> getPyfntbpedestadCollection() {
        return pyfntbpedestadCollection;
    }

    public void setPyfntbpedestadCollection(Collection<Pyfntbpedestad> pyfntbpedestadCollection) {
        this.pyfntbpedestadCollection = pyfntbpedestadCollection;
    }

    @XmlTransient
    public Collection<Pyfntbpedvicom> getPyfntbpedvicomCollection() {
        return pyfntbpedvicomCollection;
    }

    public void setPyfntbpedvicomCollection(Collection<Pyfntbpedvicom> pyfntbpedvicomCollection) {
        this.pyfntbpedvicomCollection = pyfntbpedvicomCollection;
    }

    @XmlTransient
    public Collection<Pyfntbpersvico> getPyfntbpersvicoCollection() {
        return pyfntbpersvicoCollection;
    }

    public void setPyfntbpersvicoCollection(Collection<Pyfntbpersvico> pyfntbpersvicoCollection) {
        this.pyfntbpersvicoCollection = pyfntbpersvicoCollection;
    }

    @XmlTransient
    public Collection<Pydgtbproyec> getPydgtbproyecCollection() {
        return pydgtbproyecCollection;
    }

    public void setPydgtbproyecCollection(Collection<Pydgtbproyec> pydgtbproyecCollection) {
        this.pydgtbproyecCollection = pydgtbproyecCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scittbfadeceid != null ? scittbfadeceid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scittbfadece)) {
            return false;
        }
        Scittbfadece other = (Scittbfadece) object;
        if ((this.scittbfadeceid == null && other.scittbfadeceid != null) || (this.scittbfadeceid != null && !this.scittbfadeceid.equals(other.scittbfadeceid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scittbfadece[ scittbfadeceid=" + scittbfadeceid + " ]";
    }
    
}
